<?php  
  
    if( isset($_POST['sujet'])  &&  isset($_POST['mail'])
$result=mysql_query("SELECT mail FROM `ap3_sp_utilisateur` WHERE  newletter=1");
    
     $headers = 'From: noreply@cotedetente.com' . "\r\n" .
     'Reply-To: noreply@cotedetente.com' . "\r\n" .
     'X-Mailer: PHP/' . phpversion();
     
$adresse=array();
while ($am=mysql_fetch_assoc($result))
{$adresse[]=$am;
}       
  
  foreach($adresse as $a)  
    mail($a, $_POST['sujet'], $_POST['mail'],$header);
    
header ("location: .?page=".$_POST['page']);
    
    
?>